package router

import (
	"github.com/gin-gonic/gin"
	"go_es/server/api"
	"go_es/server/middleware"
)

type UserRouter struct{}

func (s *UserRouter) InitUserRouter(Router *gin.RouterGroup) {
	userRouter := Router.Group("user").Use(middleware.OperationRecord())
	userRouterWithoutRecord := Router.Group("user")
	baseApi := api.ApiGroupApp.BaseApi
	{
		userRouter.GET("getUserInfo", baseApi.GetUserInfo) // 获取自身信息
		userRouter.POST("setUserAuthorities", baseApi.SetUserAuthorities) // 设置用户权限组
		userRouter.PUT("resetPassword", baseApi.ResetPassword)           // 重置密码
	}
	{
		userRouterWithoutRecord.POST("getUserList", baseApi.GetUserList) // 分页获取用户列表
	}
}